<?php
/*
 * @Author: your name
 * @Date: 2019-11-01 14:17:13
 * @LastEditTime : 2019-12-24 11:31:53
 * @LastEditors  : Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: /ahsmp_3/application/common/service/HostAccessLogConfig.php
 */

namespace app\common\service;


class HostAccessLogConfig extends Base 

{
    /**
     * @name: 添加
     * @Param: 
     * @Description: 
     * @Author: foo
     * @Date: 2019-10-29 14:01:50
     */
    function add ($host_id)
    {

        if(db('HostAccessLogConfig')->where('host_id', $host_id)->count() > 0)
        {
            return [];
        }

        db('HostAccessLogConfig')->insert(['host_id' => $host_id]);

    }

    /**
     * @name: 删除
     * @Param: 
     * @Description: 
     * @Author: foo
     * @Date: 2019-12-24 11:27:28
     */
    function del ($host_id_a)
    {
        db('HostAccessLogConfig')->whereIn('host_id', $host_id_a)->delete();
    }

    /**
     * @name 查询
     * @param $condition
     * @return array|null|\PDOStatement|string|\think\Model
     * @author wx
     * @date 2019/11/1 10:42
     */
    function findData($condition)
    {
        return db('host_access_log_config')->where($condition)->find();
    }

    /***
     * @name 修改
     * @param $condition
     * @param $updateData
     * @return int|string
     * @author wx
     * @date time
     */
    function modify($condition, $updateData)
    {
        return db('host_access_log_config')->where($condition)->update($updateData);
    }
}